@extends('layouts.master')

@section("css")
    @parent
    <link rel="stylesheet" type="text/css" href="/css/pages/list.css">
    <link rel="stylesheet" type="text/css" href="/css/pages/account/list.css">
@stop

@section("body")
@include("components.left")

<div class="list_content">
    <div class="list_table">
        <table>
            <thead>
                <tr>
                    <th>编号</th>
                    <th>姓名</th>
                    <th>登录账号</th>
                    <th>角色</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
                @foreach($users as $user)
               <tr>
                   <td>{{$user['id']}}</td>
                   <td><input id="name" type="" name="" value="{{$user['name']}}"></td>
                   <td><input id="uname" type="" name="" value="{{$user['uname']}}"></td>
                   <td>
                       <select id="role_id">
                           @foreach($roles as $role)
                                <option value="{{$role['id']}}"
                                    @if($role['id'] == $user['role_id'])
                                        selected
                                    @endif
                                >{{$role['role_name']}}</option>
                           @endforeach
                       </select>
                   </td>
                   <td>
                       <div class="get_btn">修改</div>
                       <div id='delete_btn' class="delete_btn">删除</div>
                   </td>
               </tr>
               @endforeach
            </tbody>
        </table>
    </div>
</div>

@stop

@section("js")
    @parent
    <script type="text/javascript" src="/js/pages/account/list.js"></script>
@stop